<include file="../Public/header" />
<link href="{:APPS_URL}/w3g/_static/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
  body{background-color: #f8f8f8;}
</style>
<div id="content">
    <div id="weiba" data-title="地区" class="panel" data-selected="true"  data-menu="msgmenu" style="padding:0;">
        <header>
            <div id="header-buttons">
                <a href="javascript:history.go(-1);">
                    <div id="back" class="header-menu-link" data-back="false">
                    </div>
                </a>
            </div>
            <h1 class="hasback">
                地区
            </h1>
        </header>
    <div class="set-item" id="">
         <div class="set_s">
            {:W('Area',array('curPro'=>$user_info['province'],'curCity'=>$user_info['city'],'area'=>$user_info['area'],'city_names'=>$user_info['location'],'tpl'=>'selectArea'))}
         </div>
         <div class="setBtn"><a href="javascript:;" class="btn-big" onclick="setArea()">保存</a></div>
    </div>
</div>
<script type="text/javascript">
    function setArea(){
       if($('#province').val()==0 || $('#city').val() == 0 || $('#area').val()==0){
           $.ui.showMask("地区信息不完整", true);
           return false;
       }
      $.ajax({
        type : 'post',
        url : location.href,
        data: {'ajaxSubmit':1,'province': $('#province').val(),'city': $('#city').val(),'area': $('#area').val()},
        timeout : 10000,
        dataType: 'json',
        success : function(d){
            if(d && d.status){
                location.href=U('w3g/Setting/base');
            }
            else{
                $.ui.showMask(d.info,true);
            }
        },
        error: function(r){
            $.ui.showMask("连接服务器失败，请重试:)",true);
        }
      });
    }
</script>
<include file="../Public/footer" />